-----------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/juanpablouribetrujillo/My Drive (jp.uribe86@gmail.com)/Research/MyPapers/MTU/JUE/analys
> is/compare_MTU_BL.log
  log type:  text
 opened on:  24 Jun 2024, 22:04:54

. *Some settings that are common for the set of plots on this dofile;
.  local pdf_plot_settings =      `"scale(*1.5) ymtick(##4) leg(off) "';

. *settings for latex tables ;
. local tex_settigns  = `" prehead(\begin{table}[H]\centering
>         \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
>         \caption{@title}
>         \setlength{\tabcolsep}{3pt}
>         \begin{tabular}{l*{@span}{c}}
>         \hline\hline)
>         postfoot(\hline\hline
>         \multicolumn{@span}{l}{\footnotesize Standard errors clustered by state in parenthesis.  }\\
>         \multicolumn{@span}{l}{\footnotesize @starlegend.   }
>         \end{tabular}\end{table})       "'      ;

.         local tex_settigns_adj  = `" 
>         prehead(\begin{table}[H]\centering
>         \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
>         \begin{adjustbox}{max width=\textwidth,max totalheight=\textheight}
>         \caption{@title}
>         \begin{tabular}{l*{@span}{c}}
>         \hline\hline)
>         postfoot(\hline\hline
>         \multicolumn{@span}{l}{\footnotesize Standard errors clustered by state in parenthesis.  }\\
>         \multicolumn{@span}{l}{\footnotesize @starlegend.   }
>         \end{tabular}\end{adjustbox}\end{table})                "'      ;

.         *----------------------------------------------------------------------------------;
. ****************************************;
.         use "../data/state_year_all_80_15.dta", clear  ;

. *---------------------------------------------------;
. * - Generate variables and general cleanings ;
. *---------------------------------------------------;
. do "_setup_expenditure.do";

. /******************************************************************
> 
> setup_expenditure.do
> 
> Subroutine to calculate expenditure variables for all analysis programs;
> 
> mt 20190506
> *******************************************************************/
. # delim ;  
delimiter now ;
. * expenditure on length and IRI from SF12a. Check that categories are right. Can we break apart ROW?;
. *conversion factor to get to 10^6 2010 dollars;
. gen deflate= 1/(ppiaco_2010*10);

. *gen deflate= 1;
. *consolidate rural and urban SF12a variables that we need;
. local rur_urb_list      "exp_eng_row_IH                 exp_row_IH              exp_eng_IH              e
> xp_new_cons_IH
>                         exp_relocation_IH               exp_recons_IH           exp_recons_add_IH       e
> xp_recons_noadd_IH
>                         exp_maj_wide_IH                 exp_R3_IH               exp_R3_min_wide_IH      e
> xp_R3_rehab_rest_IH    
>                         exp_R3_resurf_IH
>                         exp_new_bridge_IH exp_bridgereplacement_IH exp_majorbridgerehab_IH exp_minorbridg
> erehab_IH exp_bridge_IH
>                         ";

. foreach exp_var of local rur_urb_list{;
  2.                 replace `exp_var'_urban=cond(`exp_var'_urban==.,0,`exp_var'_urban);
  3.                 replace `exp_var'_rural=cond(`exp_var'_rural==.,0,`exp_var'_rural);
  4.                 gen `exp_var'_all = `exp_var'_urban + `exp_var'_rural;
  5.                 drop `exp_var'_urban `exp_var'_rural;
  6.                 };
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)
(565 real changes made)
(564 real changes made)

. *consolidate SF12a variables into nominal construction and resurfacing for pre and post 1998;
. *NB: exp_new_cons_IH_all and exp_maj_wide_IH_all are common to pre and post 1998 construction;
. gen exp_L_IH_SF12a_n_old=       exp_eng_row_IH_all + exp_new_cons_IH_all + exp_maj_wide_IH_all;

. gen exp_IRI_IH_SF12a_n_old=     exp_recons_IH_all  + exp_R3_IH_all;

.  gen exp_L_IH_SF12a_n_new=      exp_row_IH_all     + exp_eng_IH_all      + exp_new_cons_IH_all  + exp_rel
> ocation_IH_all + exp_maj_wide_IH_all;

.                         gen exp_IRI_IH_SF12a_n_new=     exp_recons_add_IH  + exp_recons_noadd_IH + exp_R3
> _min_wide_IH   + exp_R3_rehab_rest_IH  + exp_R3_resurf_IH;

. * Do the same for bridge expenditure ;
. gen exp_bridge_IH_SF12a_n_new=cond( year>1998,
>                                                                         exp_new_bridge_IH_all+exp_bridger
> eplacement_IH_all+exp_majorbridgerehab_IH_all+exp_minorbridgerehab_IH_all,.);
(931 missing values generated)

.                                                                         gen exp_bridge_IH_SF12a_n_old=con
> d( year<=1998,
>                                                                         exp_bridge_IH_all,.);
(833 missing values generated)

. *diagnostics -- should all be zero -- this test won't work for construction;
. sum exp_IRI_IH_SF12a_n_new exp_IRI_IH_SF12a_n_old if year>1998;

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
exp_IRI_IH~w |        833    75901.17    142629.8          0    1142287
exp_IRI_IH~d |        833           0           0          0          0

. sum exp_IRI_IH_SF12a_n_new exp_IRI_IH_SF12a_n_old if year<=1998;

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
exp_IRI_IH~w |        931           0           0          0          0
exp_IRI_IH~d |        931    47717.58    68779.22          0     560136

. *consolidate pre and post 1998 variable construction;
. gen exp_IRI_IH_SF12a_n =        cond(year>1998, exp_IRI_IH_SF12a_n_new, exp_IRI_IH_SF12a_n_old);

. gen exp_L_IH_SF12a_n =          cond(year>1998, exp_L_IH_SF12a_n_new, exp_L_IH_SF12a_n_old);

. gen exp_bridge_IH_SF12a_n =             cond(year>1998, exp_bridge_IH_SF12a_n_new, exp_bridge_IH_SF12a_n_
> old);

. *clean up -- save reloacation;
. gen temp = exp_relocation_IH_all;

. gen temp2 =exp_row_IH_all ;

. foreach exp_var of local rur_urb_list{;
  2.                 drop `exp_var'_all;
  3.                 };

.                 drop *_new *_old;

. rename temp exp_relocation_IH_all_n;

.  rename temp2 exp_row_IH_all_n ;

. *calculate total IH and SF12a maintenance;
. gen exp_IH_total_SF12_n = exp_IH_mtn_all + exp_IH_k_all;
(180 missing values generated)

. gen exp_IH_mtn_SF12a_n = exp_IH_total_SF12_n - exp_IRI_IH_SF12a_n - exp_L_IH_SF12a_n -exp_bridge_IH_SF12a
> _n;
(180 missing values generated)

. sum exp_IH_mtn_SF12a_n, d ;

                     exp_IH_mtn_SF12a_n
-------------------------------------------------------------
      Percentiles      Smallest
 1%       -34577        -796329
 5%            0        -387772
10%         4495        -242600       Obs               1,584
25%        13109        -198478       Sum of wgt.       1,584

50%     33878.59                      Mean           108119.7
                        Largest       Std. dev.      250930.4
75%     94553.93        2017193
90%       252167        2062267       Variance       6.30e+10
95%       424198        3278198       Skewness       5.866655
99%      1313969        3303381       Kurtosis         52.087

. replace exp_IH_mtn_SF12a_n= cond(exp_IH_mtn_SF12a_n<0,0,exp_IH_mtn_SF12a_n );
(27 real changes made)

. sum exp_IH_mtn_SF12a_n, d ;

                     exp_IH_mtn_SF12a_n
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%         4495              0       Obs               1,584
25%        13109              0       Sum of wgt.       1,584

50%     33878.59                      Mean           109822.3
                        Largest       Std. dev.      248973.5
75%     94553.93        2017193
90%       252167        2062267       Variance       6.20e+10
95%       424198        3278198       Skewness       6.026436
99%      1313969        3303381       Kurtosis       53.45254

. ;
. *convert to real 2010 USD 10^6;
. *NB: deflate calculated in calling program;
. rename app_IH app_IH_n;

. rename exp_IH_mtn_all exp_IH_mtn_SF12_n;

. ren rev_grand_total_mt rev_grand_total_mt_n;

. ren rev_total_h rev_total_h_n;

. ren rev_total_mt rev_total_mt_n ;

. ren rev_total_m_fuel_h rev_total_m_fuel_h_n ;

. local real_list "exp_IH_total_SF12 exp_IH_mtn_SF12a exp_IRI_IH_SF12a exp_L_IH_SF12a app_IH exp_IH_mtn_SF1
> 2 exp_relocation_IH_all 
>                                  rev_grand_total_mt rev_total_h rev_total_mt rev_total_m_fuel_h
>                                  exp_bridge_IH_SF12a exp_row_IH_all
>                                  ";

. foreach exp_var of local real_list{;
  2.                 gen `exp_var'_r=deflate*`exp_var'_n;
  3.                 drop `exp_var'_n;
  4.                 };
(180 missing values generated)
(180 missing values generated)
(900 missing values generated)
(180 missing values generated)
(996 missing values generated)
(228 missing values generated)
(996 missing values generated)
(228 missing values generated)

.         forvalues i=1(1)5{;
  2.                                 gen deflate_L`i'= 1/(ppiaco_2010_L`i'*10);
  3.                 ren L`i'FHWA_apport_LW L`i'FHWA_apport_LW_n;
  4.                 gen L`i'FHWA_apport_LW_r=deflate_L`i'*L`i'FHWA_apport_LW_n;
  5.                 drop L`i'FHWA_apport_LW_n;
  6. };
(132 missing values generated)
(180 missing values generated)
(228 missing values generated)
(276 missing values generated)
(324 missing values generated)

.                                                 *label and drop superflous expenditure data;
. label var       exp_IH_total_SF12_r     "Total IH exp SF12 real";

. label var       exp_IH_mtn_SF12_r       "Total IH maint exp SF12 real";

. label var       exp_IH_mtn_SF12a_r      "Total IH maint exp SF12a real";

.  label var      exp_IRI_IH_SF12a_r      "Total IH IRI exp SF12a real";

.  label var      exp_L_IH_SF12a_r        "Total IH L exp SF12a real";

. label var       app_IH_r                "Total IH approp real";

. label var       exp_relocation_IH_all   "Total IH exp relocation, >1998";

. label var   rev_grand_total_mt_r          "Total revenue mass transit account real [source: FE9 p2 ]";

. label var   rev_total_mt_r        "Total revenue highway and mass transit account real [source: FE9 p2 ]"
> ;

. label var   rev_total_h  "Total revenue highway account real [source: FE9 p2 ]";

. label var rev_total_m_fuel_h                     "Total Revenue motor fuel  (Highway motor fuel) [source:
>  FE9 p1 ]";

.         *drop exp_IH_k_rural-exp_subtotal_mtn_urban;
. exit;

end of do-file

. do "_cleaning_and_new_variables.do";

. 
. 
. 
. 
. # d ; 
delimiter now ;
. *label variables to mathc the names in the tables ;
. label var exp_L_IH_SF12a_r "\(I^{L}_{st} \)";

. label var  exp_IRI_IH_SF12a_r "\( Y^L\:in\:IRI \)";

. label var  exp_IH_mtn_SF12a_r "\( Y^L\: in\: Maint.\)";

. *make lagged expenditure and appropriations;
. sort state year;

. gen L1exp_L_IH_SF12a_r=cond(
>                         state[_n]==year[_n-1],
>                         year[_n-1]==year[_n]-1,
>                         exp_L_IH_SF12a_r[_n-1],.);
(1 missing value generated)

. gen L5app_IH_r=cond(
>                         state[_n]==year[_n-5],
>                         year[_n-5]==year[_n]-5,
>                         app_IH_r[_n-5],.);
(901 missing values generated)

.                         gen L1app_IH_r=cond(
>                         state[_n]==year[_n-1],
>                         year[_n-1]==year[_n]-1,
>                         app_IH_r[_n-1],.);
(900 missing values generated)

.                                                                         *calculate first differences in m
> iles and IRI;
. *local D_vars "u_iri_IH u_iri_urban u_iri_rural u_lane_miles_IH u_lane_miles_rural u_lane_miles_urban";
. local D_vars u_lane_miles_IH  u_lane_miles_rural u_lane_miles_urban u_miles_IH;

. sort state year;

. foreach varname of local D_vars{;
  2.                 gen D`varname'=cond(
>                                 state[_n]==state[_n-1]&
>                                 `varname'[_n-1]!=.&`varname'[_n]!=.&
>                                 `varname'[_n-1]!=0&`varname'[_n]!=0&
>                                 year[_n-1]==year[_n]-1,
>                                 `varname'[_n]-`varname'[_n-1],.);
  3.                                 };
(342 missing values generated)
(402 missing values generated)
(346 missing values generated)
(342 missing values generated)

.                                 *Create average width of lane miles ;
. gen u_width_IH= u_lane_miles_IH/u_miles_IH;
(293 missing values generated)

. label var u_width_IH "Avergae width of lanes";

.                                 *create expantion lanes in existing segments and new segments;
.                                 gen Du_expantion_miles_IH=cond(
>                                 state[_n]==state[_n-1]&
>                                 u_lane_miles_IH[_n-1]!=.&u_lane_miles_IH[_n]!=.&
>                                 u_miles_IH[_n-1]!=.&u_miles_IH[_n]!=.&
>                                 year[_n-1]==year[_n]-1,
>                                 Du_lane_miles_IH - Du_miles_IH*u_width_IH[_n-1],
>                                 .);
(342 missing values generated)

. *replace Du_expantion_miles_IH=0 if Du_expantion_miles_IH<0;
.                         label var Du_expantion_miles_IH "Expansion miles";

.                                 //note: The assumption to create this variable is that the new miles occu
> rs at mean width ;
> 
> gen sh_new_lm=cond(state[_n]==state[_n-1]&
>                                 u_lane_miles_IH[_n-1]!=.&u_lane_miles_IH[_n]!=.&
>                                 u_miles_IH[_n-1]!=.&u_miles_IH[_n]!=.&
>                                 year[_n-1]==year[_n]-1, Du_miles_IH*u_width_IH/Du_lane_miles_IH,.) ;
(494 missing values generated)

. *replace sh_new_lm=1 if Du_expantion_miles_IH==0 & Du_lane_miles_IH>0;
. label var sh_new_lm "Share of new lane miles in new segments";

. gen sh_exp_lm= Du_expantion_miles_IH/Du_lane_miles_IH;
(494 missing values generated)

. label var sh_exp_lm "Share of new lane miles that are expantions";

. *dropping missing d_lane_miles saves trouble later;
. * keep all years with lagge appropriations;
. * N.B.: Nothing strange here.  SF12a missing <1984;
. drop if year>2008|year<1980;
(343 observations deleted)

. drop if u_lane_miles_IH==.;
(0 observations deleted)

. drop if u_lane_miles_IH==0;
(0 observations deleted)

. drop if u_lane_miles_IH<0;
(0 observations deleted)

. *drop DC;
. drop if state==11;
(29 observations deleted)

. * time, for estimating trends;
. gen time =year-1984;

. gen time2 =time^2;

. gen time3 =time^3;

. label var time2 "\(time^2\)" ;

. label var time3 "\(time^3\)" ;

. *TIME TREND DUMMIES;
. gen     periods=1 if  year>=1984&year<=1989;
(1,104 missing values generated)

. replace periods=2 if  year>=1990&year<=1994;
(240 real changes made)

. replace periods=3 if  year>=1995&year<=1999;
(240 real changes made)

. replace periods=4 if  year>=2000&year<=2004;
(240 real changes made)

. replace periods=5 if  year>=2005&year<=2008;
(192 real changes made)

. tab year periods, m ;

           |                              periods
 Book year |         1          2          3          4          5          . |     Total
-----------+------------------------------------------------------------------+----------
      1980 |         0          0          0          0          0         48 |        48 
      1981 |         0          0          0          0          0         48 |        48 
      1982 |         0          0          0          0          0         48 |        48 
      1983 |         0          0          0          0          0         48 |        48 
      1984 |        48          0          0          0          0          0 |        48 
      1985 |        48          0          0          0          0          0 |        48 
      1986 |        48          0          0          0          0          0 |        48 
      1987 |        48          0          0          0          0          0 |        48 
      1988 |        48          0          0          0          0          0 |        48 
      1989 |        48          0          0          0          0          0 |        48 
      1990 |         0         48          0          0          0          0 |        48 
      1991 |         0         48          0          0          0          0 |        48 
      1992 |         0         48          0          0          0          0 |        48 
      1993 |         0         48          0          0          0          0 |        48 
      1994 |         0         48          0          0          0          0 |        48 
      1995 |         0          0         48          0          0          0 |        48 
      1996 |         0          0         48          0          0          0 |        48 
      1997 |         0          0         48          0          0          0 |        48 
      1998 |         0          0         48          0          0          0 |        48 
      1999 |         0          0         48          0          0          0 |        48 
      2000 |         0          0          0         48          0          0 |        48 
      2001 |         0          0          0         48          0          0 |        48 
      2002 |         0          0          0         48          0          0 |        48 
      2003 |         0          0          0         48          0          0 |        48 
      2004 |         0          0          0         48          0          0 |        48 
      2005 |         0          0          0          0         48          0 |        48 
      2006 |         0          0          0          0         48          0 |        48 
      2007 |         0          0          0          0         48          0 |        48 
      2008 |         0          0          0          0         48          0 |        48 
-----------+------------------------------------------------------------------+----------
     Total |       288        240        240        240        192        192 |     1,392 

. label define periods 1 "1984-1989"
>                                         2 "1990-1994"
>                                         3 "1995-1999"
>                                         4 "2000-2004"
>                                         5 "2005-2008";

. label values periods periods;

. # d cr ;
delimiter now cr
. 
. 
end of do-file

. tab year periods ;

           |                        periods
 Book year | 1984-1989  1990-1994  1995-1999  2000-2004  2005-2008 |     Total
-----------+-------------------------------------------------------+----------
      1984 |        48          0          0          0          0 |        48 
      1985 |        48          0          0          0          0 |        48 
      1986 |        48          0          0          0          0 |        48 
      1987 |        48          0          0          0          0 |        48 
      1988 |        48          0          0          0          0 |        48 
      1989 |        48          0          0          0          0 |        48 
      1990 |         0         48          0          0          0 |        48 
      1991 |         0         48          0          0          0 |        48 
      1992 |         0         48          0          0          0 |        48 
      1993 |         0         48          0          0          0 |        48 
      1994 |         0         48          0          0          0 |        48 
      1995 |         0          0         48          0          0 |        48 
      1996 |         0          0         48          0          0 |        48 
      1997 |         0          0         48          0          0 |        48 
      1998 |         0          0         48          0          0 |        48 
      1999 |         0          0         48          0          0 |        48 
      2000 |         0          0          0         48          0 |        48 
      2001 |         0          0          0         48          0 |        48 
      2002 |         0          0          0         48          0 |        48 
      2003 |         0          0          0         48          0 |        48 
      2004 |         0          0          0         48          0 |        48 
      2005 |         0          0          0          0         48 |        48 
      2006 |         0          0          0          0         48 |        48 
      2007 |         0          0          0          0         48 |        48 
      2008 |         0          0          0          0         48 |        48 
-----------+-------------------------------------------------------+----------
     Total |       288        240        240        240        192 |     1,200 

. sum app_IH_r exp_L_IH_SF12a_r;

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    app_IH_r |        720    112.2246    97.08455   7.157321    633.818
exp_L_IH_S~r |      1,392    116.9471    198.6732          0   2316.786

. *------------------------------------------------;
. * Run the regressions ;
. *------------------------------------------------;
. *Add Brooks and Liscow;
. xtset state year;

Panel variable: state (strongly balanced)
 Time variable: year, 1980 to 2008
         Delta: 1 year

. gen statefips=state;

. merge 1:1 statefips year   using "../data/20200707_brooks_liscow_annual_data.dta", nogen  ;
(variable year was int, now float to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                         1,872
        from master                       720  
        from using                      1,152  

    Matched                               672  
    -----------------------------------------

. ren allMiles all_newmiles;

. duplicates tag state_abrev year, gen(xx);

Duplicates in terms of state_abrev year

. tab xx;

         xx |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      1,824       71.70       71.70
         47 |        720       28.30      100.00
------------+-----------------------------------
      Total |      2,544      100.00

. merge m:1 state_abrev year   using "../data/20200707_brooks_liscow_6yrpd_data.dta" ;

    Result                      Number of obs
    -----------------------------------------
    Not matched                         2,256
        from master                     2,256  (_merge==1)
        from using                          0  (_merge==2)

    Matched                               288  (_merge==3)
    -----------------------------------------

. sort state year ;

. drop xx;

.  xtset statefips year;

Panel variable: statefips (strongly balanced)
 Time variable: year, 1956 to 2008
         Delta: 1 year

. *- New miles ;
. *--------------------------;
. gen  allMiles_x=allMiles if allMiles!=0;
(2,274 missing values generated)

. gen all_newmiles_x=all_newmiles if all_newmiles!=0;
(1,271 missing values generated)

. gen Du_miles_IH_x =Du_miles_IH if Du_miles_IH!=0;
(1,371 missing values generated)

. gen scaled_spending_1000=scaled_spending/1000;
(721 missing values generated)

. gen  exp_L_bridge_IH_SF12a_r = exp_L_IH_SF12a_r + exp_bridge_IH_SF12a_r;
(1,152 missing values generated)

. *Transform BL into a stock variable using our miles in 1994;
.  gen BL_Miles=u_miles_IH if year==1994 ;
(2,496 missing values generated)

. forvalues y = 0(1)38{;
  2.         replace  BL_Miles=f.BL_Miles - all_newmiles if year ==1993-`y';
  3. };
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(48 real changes made)
(0 real changes made)

. *transform into 2016 prices ;
. replace exp_L_bridge_IH_SF12a_r=exp_L_bridge_IH_SF12a_r*ppiaco_2010/ppiaco_2016;
(1,172 real changes made)

. replace exp_L_IH_SF12a_r=exp_L_IH_SF12a_r*ppiaco_2010/ppiaco_2016;
(1,171 real changes made)

. foreach x in u_miles_IH  u_lane_miles_IH BL_Miles{;
  2.         replace `x'=`x'/1000;
  3. };
(1,392 real changes made)
(1,392 real changes made)
(1,872 real changes made)

. *Aggregate to a national total;
. collapse (sum) allMiles all_newmiles Du_lane_miles_IH u_lane_miles_IH u_miles_IH Du_expantion_miles_IH
>                          scaled_spending_1000 exp_L_IH_SF12a_r  exp_L_bridge_IH_SF12a_r BL_Miles Du_miles
> _IH_x
>                          , by(year);

. *convert BL to 2016 prices ;
. sum exp_L_IH_SF12a_r if year==2016;

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
exp_L_IH_S~r |          0

.                  * - miles- normalized ;
. foreach var in u_miles_IH u_lane_miles BL_Miles{;
  2.         sum `var' if year==1984;
  3.         gen `var'_norm=`var'/r(mean);
  4. };

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
  u_miles_IH |          1    42.18863           .   42.18863   42.18863

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
u_lane_mil~H |          1    185.1086           .   185.1086   185.1086

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    BL_Miles |          1    42.43225           .   42.43225   42.43225

.                          tw 
>    (con   u_miles_IH_norm year if year>1983 , yaxis(1 )
>    color(    gs9 )  lp(dash) lw( *2.5) msize( *0.35 5)           )
>     (con  u_lane_miles_norm year if year>1983 , yaxis( 1)
>    color(  gs0   )  lp(solid ) lw( *2 ) msize( *0.35 )           )
>    
>    (con BL_Miles_norm  year if year<1994 &  year>1979 ,
> lp(dot ) lw(*4 ) msize(*0.35) color( gs4  )) ,
>         xmtick(1980(1)2010)
>                 xlabel(1980(10)2010)
>                 xtitle("")
> 
>                 leg( region(color(none))
>                         label( 3 "BL-Miles")
>                         label( 2 "MTU-LM ")
>                         label( 1 "MTU-Miles")
>                          ring(0) pos(5) col(1) size(*.55) order(3 2 1))
>                          
>                          ymtick(##4)
>                          ylabel(, format(%12.2fc))
>                          
>                         ytitle("") 
>                 scale(*1.5)     ;
(note:  named style med not found in class gsize, default attributes used)

.                                 graph export "${output}/figures//FigureA1_compare_MTU_BL.pdf", replace;
file /Users/juanpablouribetrujillo/My Drive
    (jp.uribe86@gmail.com)/Research/MyPapers/MTU/JUE//figures//FigureA1_compare_MTU_BL.pdf saved as PDF
    format

.                         log close;
      name:  <unnamed>
       log:  /Users/juanpablouribetrujillo/My Drive (jp.uribe86@gmail.com)/Research/MyPapers/MTU/JUE/analys
> is/compare_MTU_BL.log
  log type:  text
 closed on:  24 Jun 2024, 22:05:00
-----------------------------------------------------------------------------------------------------------
